Universal Image Loader - Copyright  2026 3delite. All rights reserved.
=======================================================================

What's the point?
=================

Universal Image Loader is a little library to load images to TBitmap and TBitmap32. Uses Free Image Library (FreeImage.dll), LibRAW (libraw.dll) and the WIC system for loading and saving of picture files.

Features:

- Load all the supported picture file formats supported by the loaders
- Load and resize pictures in one go with high quality resamplers
- Load from file, TStream, resource or memory location
- 32 bit transparent pictures and bit depths above 32 bits are fully supported
- The functions are thread-safe
- VCL TBitmap and Graphics32 TBitmap32 versions of the functions
- Supported platforms: Win32 and Win64 (and experimental WinARM64)

Note: In Lazarus/FPC WIC functionality is not available.

You should see the included example program tutorials' source codes for example of how to use the component in your own programs.


Requirements:
=============

Delphi 12 Athens optionally with Graphics32.
Lazarus/FPC.
C++. The C++ header files for the DLL version were generated by ChatGPT and it is not tested.
To have a header for the DLL version for any language ask an AI and provide 'UniversalImageLoaderLibraryDefs.pas' and ask for a conversion to the particular langauge.


Installation:
=============

If Graphics32 is not already installed, it's recommended to install it - although it's not needed to install it to compile, it's enough to have the Graphics32 units on the search path. But Graphics32 is a great component you might want to decide to use it. 
Latest version of Graphics32 can be downloaded from: https://github.com/graphics32/graphics32

Add to uses list 'UniversalImageLoader' and to the search path the folder where 'UniversalImageLoader.pas' is.

Note: Using the native Delphi/FPC component does not need 'UniversalImageLoaderLibrary.dll', only when explicitly using the DLL version.


WIC support:
============

To use the WIC system CoInitialize() must be called before calling the functions.


Using the component with Graphics32:
====================================

To enable Graphics32 support add to the project's conditional defines: 'LIBRAWUSEGR32' and 'USEGR32'.


Using FreeImageLoader.pas unit:
===============================

Add to the uses list 'FreeImageLoader' to access all the advanced Free Image Library loader functions.


TUILLoadParameters:
===================

    TUILLoadParameters = record
        Loaders: TUILLoaders;
        Width: Integer;
        Height: Integer;
        KeepAspectRatio: Boolean;
        DontResizeSmaller: Boolean;
        Resampler: FREE_IMAGE_FILTER;
        GR32Resampler: TUILGR32Resampler;
        GR32ResamplerBackgroundColor: Cardinal; //* ARGB
        JPEGReducedMaxWidth: Integer;
        RAWUseCWB: Boolean;
        RAWHalfSize: Boolean;
    end;

Loaders: Loaders to try when loading the image ('uilLibRAW', 'uilFIL', 'uilWIC' tried in this order). Default value is all loaders.

Width, Height: Resize the image after loading, value of '0' means no resize. Default values are both '0'.

KeepAspectRatio: Maintain aspect ratio when resizing the image. Set to 'False' if a concrete dimensions are needed. Default value is 'True'.

DontResizeSmaller: If the requested resize results larger image than the original don not resize. Set to 'False' if concrete dimensions are needed. Default value is 'True'.

Resampler: Free Image Library resampler filter to use when resizing the bitmap. This value is used when the loading is performed by Free Image Library and when using the VCL TBitmap methods for LibRAW and WIC in case a resize is required. The available filters are specified in 'FreeImage.pas'. Default value is 'FILTER_LANCZOS3'.

GR32Resampler: Graphics32 resampler filter to use when resizing the bitmap. This value is used when working with TBitmap32 bitmaps and the loading is performed by LibRAW or WIC and when using the Graphics32 TBitmap32 methods in case a resize is required. The available filters are specified in 'UniversalImageLoader.pas'. Default value is 'GR32_RASAMPLER_LANCZOS'.

GR32ResamplerBackgroundColor: If the TBitmap32 to be resized is transparent the background is cleared with this ARGB value. Affects also how semi-transparent pixels appear, set this value to the actual background color where the bitmap will appear. Eg. for white '$00FFFFFF'. Default value is transparent black '$00000000'.

JPEGReducedMaxWidth: When loading a JPEG picture it is possible to decode 2x, 4x, 8x smaller than the original. This results a major speed-up when only a thumbnail is needed. Eg. set the value to '160'. Default value is '0'.

RAWUseCWB: Set LibRAW to decode the RAW camera photo file with camera white balance correction. If the value is 'False' no correction is applyed. In most cases this value should be always 'True'. Default value is 'True'.

RAWHalfSize: Set LibRAW to decode the RAW camera photo file at half size (4x less pixels required, eg. a 1000 x 1000 picture results a 500 x 500 pixel bitmap). This results a major speed-up (around 4x) when only a thumbnail is needed for example. Default value is 'False'.

Note: In Lazarus/FPC the record is not initialized to the default values, it is needed to explicitly set the values (or call InitializeTUILLoadParameters()) before passing it to the functions.


WinARM64 support:
=================

There is an experimental (not tested at all) WinARM64EC build of the 'UniversalImageLoaderLibrary.dll' and 'libraw.dll' (WinARM64/WinARM64EC) in the package, please let me know if you get any progress with it.
Could not achieve a 'FreeImage.dll' WinARM64 build though (I am a Delphi user so don't have much experience with C++/VS). If you manage to create a working configuration please contact me and I will include the WinARM64 stuff in the official package.
Note that theoretically including the Win64 DLLs by the WinARM64EC build should work fine.


Latest Version
==============

The latest version of Free Image Bitmap Library can always be found at 3delite's web site:

  https://www.3delite.hu/Object%20Pascal%20Developer%20Resources/UniversalImageLoader.html


Universal Image Loader in freeware, shareware and commercial software?
======================================================================

You can use this component in your free programs with a freeware license (non-money-making use). If like it and use it for shareware or commercial (or any other money making - advertising, in app. selling, etc.) you need a shareware or commercial license:

Universal Image Loader Freeware License: 15, for usage of the Universal Image Loader component in an unlimited number of your freeware software.

Universal Image Loader Shareware License: 45, for usage of the Universal Image Loader component in an unlimited number of your shareware software.

Universal Image Loader Commercial License: 125, for usage of the Universal Image Loader component in a single commercial software.

  https://www.3delite.hu/Object%20Pascal%20Developer%20Resources/register.html#UniversalImageLoader

For the shareware license, the product must sell for no more than 40 each. The price limit can be raised by purchasing duplicate licenses (of the same type), eg. 2 licenses doubles it.

In all cases there are no royalties to pay, and you can use all future updates without further cost, all you need to do is just obtain the newest version.

If none of these licenses match your requirements, or if you have any questions, get in touch (3delite@3delite.hu).

Free Image Library, LibRAW and Graphics32 components can be used freely, according to their licenses, with or without Universal Image Loader.


Copyright, Disclaimer, and all that other jazz
==============================================

This software is provided "as is", without warranty of ANY KIND, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The author shall NOT be held liable for ANY damage to you, your computer, or to anyone or anything else, that may result from its use, or misuse. Basically, you use it at YOUR OWN RISK.

Usage of Universal Image Loader indicates that you agree to the above conditions.

You may freely distribute the Universal Image Loader package as long as NO FEE is charged and all the files remain INTACT AND UNMODIFIED.

All trademarks and other registered names contained in the Universal Image Loader package are the property of their respective owners.


Support:
========

If you have any question, please write to: 3delite@3delite.hu


Credits
=======

Big thanks go to the developers of really cool components:

Free Image Library  2003-2019 by FreeImage - http://freeimage.sourceforge.net/
Graphics32 - http://graphics32.org/wiki/
LibRAW - https://www.libraw.org/


Bug reports, Suggestions, Comments, Enquiries, etc...
=====================================================

If you have any of the aforementioned please e-mail:

3delite@3delite.hu


History
=======

1.0.1.40 07/08/2026
-------------------
First beta release.

1.0.2.52 08/08/2026
-------------------
Second beta release.

1.0.3.54 09/08/2026
-------------------
Third beta release.

1.0.4.55 09/08/2026
-------------------
Fourth beta release.

1.0.5.56 09/08/2026
-------------------
Fifth beta release.

1.0.6.58 10/08/2026
-------------------
Sixth beta release.

1.0.7.59 10/08/2026
-------------------
Seventh beta release.

1.0.8.60 11/08/2026
-------------------
Eighth beta release.

1.0.10.62 15/08/2026
--------------------
Ninth beta release.

1.0.11.64 19/08/2026
--------------------
First stable release.

1.0.12.65 25/08/2026
--------------------
+ Added functions to load images from resources
+ Added new function FILoadRescaleSave() to load, resize and save in one go - does not load the image into Delphi so supports bit depths above 32 bits
* Improved GetInfo()

1.0.14.66 26/08/2026
--------------------
* Fixed loading JPEG files with reduced dimensions and reporting the original size

1.0.15.68 27/08/2026
--------------------
* Small fixes and improvements

1.0.16.69 11/09/2026
--------------------
* Fixed 24 bit FIL loading
* Improvements to WinARM64 support
